package com.yixiu.study.juc.sync;

/**
 * @CalssName T01_sync
 * @Description
 * @Author yixiu
 * @Date 2021/6/23 19:46
 * @Verison num1.0
 **/
public class T01_sync {

    private static int count = 10;

    public synchronized static void m(){
        count--;
        System.out.println(Thread.currentThread().getName() + " count=" + count);
    }

    public static void mm(){
        synchronized (T01_sync.class){
            count--;
            System.out.println(Thread.currentThread().getName() + " count=" + count);
        }
    }

    public static void main(String[] args) {
//        T01_sync.m();
        T01_sync.mm();
    }

}
